package work20241207_chap8.l;

/**
 * @author zdl
 * @date 2024/12/7
 */
public class Pike implements Weapon{
    private Soldier soldier;
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void setSoldier(Soldier s) {
        this.soldier = s;
    }

    @Override
    public int fire() {
        if (soldier.getName().equals(this.name) ){
            return 1000;
        }
        return 25;
    }
}
